import java.util.HashMap;
import java.util.Map;
import java.util.TreeMap;

public class MapExample {
	public static void main(String[] args) {

		Map<Integer, String> beers = new HashMap<Integer, String>();

		beers.put(3, "Zagorka");
		beers.put(1, "Ariana");
		beers.put(2, "Shumensko");
		beers.put(6, "Kamenitza");
		beers.put(7, "Kamenitza");
		
		boolean isPresentByKey = beers.containsKey(1);
		System.out.println(isPresentByKey);

		boolean isPresentByValue = beers.containsValue("Zagorka");
		System.out.println(isPresentByValue);

		int size = beers.size();
		System.out.println(size);

		String value = beers.get(1);
		System.out.println(value);

		for (Map.Entry<Integer, String> element : beers.entrySet()) {
			System.out.printf("%d --> %s%n", element.getKey(), element.getValue());
		}

		System.out.println();
		Map<String, Integer> map = new HashMap<String, Integer>();
		map.put("Pesho", 6);
		map.put("Kiro", 4);
		map.put("Ivo", 5);
		map.put("Mimi", 4);

		System.out.println("Pesho has " + map.get("Pesho"));
		System.out.println("Ivan has " + map.get("Ivan"));

		map.remove("Kiro");

		System.out.println("All elements in the map:");
		for (String key : map.keySet()) {
			System.out.println("\t" + key + " --> " + map.get(key));
		}
	}
}
